package work.parabola.keyboardswitch.common;

import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor
public enum RoleEnum {
    MANAGER(0, "管理员"),
    NORMAL(1, "普通用户");
    private int code;

    private String value;

    public static RoleEnum codeOf(int code) {
        for (RoleEnum roleEnum : values()) {
            if (roleEnum.getCode() == code) {
                return roleEnum;
            }
        }
        return null;
    }
}
